package com.ruoyi.recommendat.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.recommendat.mapper.PartyRecommendatMapper;
import com.ruoyi.recommendat.domain.PartyRecommendat;
import com.ruoyi.recommendat.service.IPartyRecommendatService;

/**
 * 推优人员Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-13
 */
@Service
public class PartyRecommendatServiceImpl implements IPartyRecommendatService 
{
    @Autowired
    private PartyRecommendatMapper partyRecommendatMapper;

    /**
     * 查询推优人员
     * 
     * @param prId 推优人员主键
     * @return 推优人员
     */
    @Override
    public PartyRecommendat selectPartyRecommendatByPrId(Long prId)
    {
        return partyRecommendatMapper.selectPartyRecommendatByPrId(prId);
    }

    /**
     * 查询推优人员列表
     * 
     * @param partyRecommendat 推优人员
     * @return 推优人员
     */
    @Override
    @DataScope(deptAlias = "d",userAlias = "d")
    public List<PartyRecommendat> selectPartyRecommendatList(PartyRecommendat partyRecommendat)
    {
        return partyRecommendatMapper.selectPartyRecommendatList(partyRecommendat);
    }

    /**
     * 新增推优人员
     * 
     * @param partyRecommendat 推优人员
     * @return 结果
     */
    @Override
    public int insertPartyRecommendat(PartyRecommendat partyRecommendat)
    {
        return partyRecommendatMapper.insertPartyRecommendat(partyRecommendat);
    }

    /**
     * 修改推优人员
     * 
     * @param partyRecommendat 推优人员
     * @return 结果
     */
    @Override
    public int updatePartyRecommendat(PartyRecommendat partyRecommendat)
    {
        partyRecommendat.setUpdateTime(DateUtils.getNowDate());
        return partyRecommendatMapper.updatePartyRecommendat(partyRecommendat);
    }

    /**
     * 批量删除推优人员
     * 
     * @param prIds 需要删除的推优人员主键
     * @return 结果
     */
    @Override
    public int deletePartyRecommendatByPrIds(Long[] prIds)
    {
        return partyRecommendatMapper.deletePartyRecommendatByPrIds(prIds);
    }

    /**
     * 删除推优人员信息
     * 
     * @param prId 推优人员主键
     * @return 结果
     */
    @Override
    public int deletePartyRecommendatByPrId(Long prId)
    {
        return partyRecommendatMapper.deletePartyRecommendatByPrId(prId);
    }
}
